#导包
import random
random.seed(50)
#字典存储对应关系
rule_dict = {0:"石头",1:"剪刀",2:"布"}
#输入
while True:
    computer = random.randint(0,2)
    player_input = input().strip()
    if player_input not in {'0','1','2'}:
        print("输入无效，游戏结束。")
        break
    player_choice  = int(player_input)
    #判断输赢
    #平局
    if player_choice == computer:
        print(f"你出：{rule_dict[player_choice]}，电脑出：{rule_dict[computer]}，结果：平局")
        break     #判断完输赢就结束程序，不能一直玩下去
    #玩家赢
    elif (player_choice == 0 and computer == 1)or \
            (player_choice == 1 and computer == 2)or \
            (player_choice == 2 and computer == 0):
        print(f"你出：{rule_dict[player_choice]}，电脑出：{rule_dict[computer]}，结果：你胜")
        break
    #电脑赢
    else:
        print(f"你出：{rule_dict[player_choice]}，电脑出：{rule_dict[computer]}，结果：电脑胜")
        break